<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class TrainingSituationResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id'=>(integer)$this->id,
            'users_id'=>(integer)$this->users_id,
            'username'=>(string)$this->user->personalInfo->name,
            'training_frequency'=>(string)$this->training_frequency,
            'training_dueation'=>$this->training_dueation,
            'training_time'=>$this->training_time
        ];
    }
}
